package hyperNexusModel

import (
	"time"

	"github.com/wzh200x/hyperNexus/hyperNexusType"
)

type Account struct {
	BaseModel
	AccountName          string                     `gorm:"column:accountName;size:255;uniqueIndex;comment:账号名" json:"accountName"`
	PassWord             string                     `gorm:"column:passWord;comment:密码" json:"passWord"`
	ThirdPlatformType    int32                      `gorm:"column:thirdPlatformType;defalut:0;comment:第三方平台类型" json:"thirdPlatformType"`
	ThirdPlatform        string                     `gorm:"column:thirdPlatform;comment:第三方平台; default:'' " json:"thirdPlatform"`
	ThirdAccount         string                     `gorm:"column:thirdAccount;comment:第三方账号; default:''" json:"thirdAccount"`
	ThirdToken           string                     `gorm:"column:thirdToken;comment:第三方token; default:''" json:"thirdToken"`
	ThirdRefreshToken    string                     `gorm:"column:thirdRefreshToken;comment:第三方刷新token; default:''" json:"thirdRefreshToken"`
	ThirdTokenExpireTime int64                      `gorm:"column:thirdTokenExpireTime;comment:第三方token过期时间; default:0 " json:"thirdTokenExpireTime"`
	ThirdSessionKey      string                     `gorm:"column:thirdSessionKey;comment:第三方登录会话秘钥; default:''" json:"thirdSessionKey"`
	ThirdActiveReport    int32                      `gorm:"column:thirdActiveReport;comment:第三方主动上报; default:0" json:"thirdActiveReport"`
	LoginTime            time.Time                  `gorm:"column:loginTime;comment:登录时间; default:CURRENT_TIMESTAMP;precision:0 " json:"loginTime"`
	LogoutTime           time.Time                  `gorm:"column:logoutTime;comment:登出时间;precision:0" json:"logoutTime"`
	AvatarId             int32                      `gorm:"column:avatarId;comment:角色id; default:0" json:"avatarId"`
	HyperNexusAvatarId   int64                      `gorm:"column:hyperNexusAvatarId;comment:HyperNexus默认角色id; default:0;uniqueIndex" json:"hyperNexusAvatarId"`
	AvatarIds            hyperNexusType.Uint64Array `gorm:"column:avatarIds;comment:所有HyperNexus角色id;type:text" json:"avatarIds"`
}
